<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<hdjs/>	
	<script type="text/javascript">
		var goods_gid=0;
	</script>
	<!-- <if value="$field.goods_type">
		<script type="text/javascript">
			$(function(){
				$("[name='goods_type']").val("{$field.goods_type}").change();
			})
		</script>
	</if> -->
</head>
<body>
	<div class="wrap">
		<div class="menu_list">
			<ul>
				<li><a href="{|U:'index'}" class="action">商品列表</a></li>
				<li><a href="{|U:'add'}">商品添加</a></li>
			</ul>
		</div>
		<form action="" method="post" enctype="multipart/form-data">
			<!-- <input type="hidden" name="gid" value="{$field.gid}"> -->
			<div class="tab">
				<ul class="tab_menu">
					<li lab='base'><a>基本设置</a></li>
					<li lab='other'><a>其他</a></li>
					<li lab='content'><a>详情</a></li>
					<li lab='image'><a>图片列表</a></li>
					<li lab='attribute'><a>商品属性</a></li>
				</ul>
				<div class="tab_content hd-form">
					<div id="base">
						<table class="table1">
							<tr>
								<th class="w100">商品名称</th>
								<td>
									<input type="text" name="goods_name" class="w200" >
								</td>
							</tr>
							<tr>
								<th>栏目</th>
								<td>
									<select name="category_cid">
										<option value="0">==选择栏目==</option>
										<list from='$category' name='$c'>
											<option value="{$c.cid}">{$c._name}</option>
										</list>
									</select>
								</td>
							</tr>
							<tr>
								<th>商品货号</th>
								<td>
									<input type="text" name="goods_sn" class="w200" >
								</td>
							</tr>
							<tr>
								<th>属性</th>
								<td>
									<label><input type="checkbox" name="is_hot" value="1" >热门</label>
									<label ><input type="checkbox" name="is_new" value="1">新品</label>
									<label><input type="checkbox" name="is_best" value="1">精品</label>
								</td>
							</tr>
							<tr>
								<th>图片</th>
								<td>
									<input type="file" name="original_img" >
									
								</td>
							</tr>
							<tr>
								<th>状态</th>
								<td>
									<label><input type="radio" name="is_on_sale" value="1" >上架</label>
									<label><input type="radio" name="is_on_sale" value="0" >下架</label>
								</td>
							</tr>
							<tr>
								<th>商城价</th>
								<td>
									<input type="text" name="goods_price" class="w200">
								</td>
							</tr>
							<tr>
								<th>市场价</th>
								<td>
									<input type="text" name="market_price" class="w200" >
								</td>
							</tr>
						</table>
					</div>
					<div id="other">
						<table class="table1">
							<tr>
								<th class="w100">重量</th>
								<td>
									<input type="text" name="goods_weight" class="w200" value="{$field.goods_weight}">
									<select name="weight_unit">
										<option value="千克">千克</option>
										<option value="克" >克</option>
										<option value="市斤" >市斤</option>
									</select>
								</td>
							</tr>
							<tr>
								<th>上架时间</th>
								<td>
									<input type="text" readonly="readonly" id="sale_time" value="{$field.sale_time|date:'y/m/d H:i:s',@@}" class="w150">
									<script type="text/javascript">
										$('#sale_time').calendar({format:'yyyy/mm/dd HH:mm:ss'});
									</script>									
								</td>
							</tr>
							<tr>
								<th>品牌</th>
								<td>
									<select name="brand_id">
										<option value="0">==品牌选择==</option>
										<list from='$brand' name='$b'>
											<option value="{$b.brand_id}">{$b.brand_name}</option>
										</list>
									</select>
								</td>
							</tr>
							<tr>
								<th>商品数量</th>
								<td>
									<input type="text" name="goods_number" class="w200" >
								</td>
							</tr>
							<tr>
								<th>查看次数</th>
								<td>
									<input type="text" name="goods_click" class="w200" >次
								</td>
							</tr>
						</table>
					</div>
					<div id="content">
						<table class="table1">
							<tr>
								<th class="w100">关键字</th>
								<td>
									<input type="text" name="goods_key" class="w200" >
								</td>
							</tr>
							<tr>
								<th>商品描述</th>
								<td>
									<textarea name="goods_desc" class="w200 h100" ></textarea>
								</td>
							</tr>
							<tr>
								<th>详情</th>
								<td>
									<ueditor name='goods_body' />
								</td>
							</tr>
						</table>
					</div>
					<div id="image">
						<table class="table1">
							<tr class="tr_add">
								<th class="w100">详情页图片</th>
								<td>
									<div class="gallery">
										<ul>
											<list from='$gallery' name='$g'>
												<li style="float:left;margin:10px">
													<img src="__ROOT__/{$g.img_original}" width="200px" height="100px">													
												</li>
											</list>
										</ul>
									</div>

									<ul id='imageList' style="clear:both">
										<li>
											<a href="javascript:addImage()">[+]</a>
											<input type="file" name='gallery_img[]' class="w200">
										</li>
									</ul>

								</td>
							</tr>
						</table>
					</div>
					<div id="attribute">
						<table class="table1">
							<tr>
								<th class="w100">商品类型</th>
								<td>
									<select name="goods_type" id="goods_type" onchange="getAttr();">
										<option value="0">=商品属性=</option>
										<list from='$goods_type' name='$gt'>
											<option value="{$gt.cat_id}">{$gt.cat_name}</option>
										</list>
									</select>
								</td>
							</tr>
							<tr>
								<th>属性</th>
								<td>
									<div id="attr">
										
									</div>
								</td>
							</tr>
						</table>
					</div>
				</div>
			</div>
			<div class="position-bottom">
				<input type="submit" value="编辑" class="hd-success">
			</div>
			
		</form>
	</div>
	<js file='__CONTROLLER_VIEW__/Js/addEdit.js'/>
</body>
</html>